/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package res;

import java.util.Hashtable;
import org.kxml.Xml;
import org.kxml.kdom.Element;

/**
 *
 * @author Ayman
 */
public class DataContainer {

    public static String USER_TAG = "USER";
    public static String RADAR_TAG = "RADAR";
    public static String SATELLITE_TAG = "SATELLITE";
    public static String SLP_TAG = "SLP";
    public static String TEMP_TAG = "TEMP";
    public static String VISIBILITY_TAG = "VISIBILITY";
    public static String WIND_TAG = "WIND";
    private boolean valid = false;
    private Hashtable hashtable = new Hashtable();
    MapData data = null;

    public DataContainer(Element root) {
        if (root != null) {
            Element e = root.getElement(USER_TAG);
            if(e.getText().equals("VALID")){
                valid = true;
            }
            e = root.getElement(RADAR_TAG);
            hashtable.put(RADAR_TAG, new MapData(e));
            e = root.getElement(SATELLITE_TAG);
            hashtable.put(SATELLITE_TAG, new MapData(e));
            e = root.getElement(SLP_TAG);
            hashtable.put(SLP_TAG, new MapData(e));
            e = root.getElement(TEMP_TAG);
            hashtable.put(TEMP_TAG, new MapData(e));
            e = root.getElement(VISIBILITY_TAG);
            hashtable.put(VISIBILITY_TAG, new MapData(e));
            e = root.getElement(WIND_TAG);
            hashtable.put(WIND_TAG, new MapData(e));
            System.out.println("");
        }
    }
}
